using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Ploeh.AutoFixture;
using System.IO;
using FileDownloadServer;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Win32.Dialogs;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UITesting;
using Tests.Properties;
using System.Web.Http;
using Microsoft.VisualStudio.TestTools.UnitTesting.Web;
using System.Linq;
using FluentAssertions;
using ArtOfTest.Common.Win32;
using System.Diagnostics;

namespace Tests
{
	static class ChromeLauncherManager
	{
		public static async Task<ChromeLauncher> SetUp()
		{
			var browserManager = CreateBrowserManager();
			await Task.Run(() => browserManager.Start());
			return new ChromeLauncher(browserManager);
		}

		private static Manager CreateBrowserManager()
		{
			var settings = new Settings
			{
				Web = new Settings.WebSettings(BrowserType.Chrome),
				UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue
			};

			return new Manager(settings);
		}
	}
}
